package com.test1224;

public class Test07 {
    public static void main(String[] args) {
        // 求出arr中元素的平均值
        int[] arr = {6, 1, 7, 4, 3};
        double sum = 0;
        double avg = 0.0;
        for(int i=0;i<arr.length;i++){
            sum +=arr[i];
        }
        avg =sum/arr.length;
        System.out.println("平均值为"+avg);
    }
}
